<?php

namespace console\controllers;

use Yii;
use services\marketing\RepairOutpatientTypeService;
use services\marketing\RepairCallbackStatusService;
use yii\console\Controller;
use Exception;

/**
 * 各种设置数据修复
 *
 * Class CallbackStatusController
 * @package console\controllers
 */
class CallbackStatusController extends Controller
{
    /**
     * 回访状态数据修复
     */
    public function actionUpdateCallbackStatus()
    {
        try {
            $startTime = time();
            RepairCallbackStatusService::updateCallbackStatus();
            echo time() - $startTime . '==success!';
        } catch (Exception $exception) {
            echo 'error:' . $exception;
        }
    }

    /**
     * 就诊类型数据修复
     */
    public function actionUpdateOutpatientType()
    {
        try {
            $startTime = time();
            RepairOutpatientTypeService::updateOutpatientType();
            echo time() - $startTime . '==success!';
        } catch (Exception $exception) {
            echo 'error:' . $exception;
        }
    }
}
